function dlTabsTabContent()
{
	this.tab = dlTabsTab.tab;
	consoleLog("tabContent: tab: " + this.tab);
	// Progress bar in tab
	this.tab.style.removeProperty("background-color");
	this.tab.style.setProperty("background-image", 		"url(\"chrome://downloadtabs/skin/bar.png\")", 	"important");
	this.tab.style.setProperty("background-position", 	"0px 0px", 			"important");
	this.tab.style.setProperty("background-repeat", 	"repeat-y", 		"important");
	
	// On exit restore the tab
	window.addEventListener("unload",
		function(e)
		{
			// Restore various CSS properties
			dlTabsTab.tab.style.MozBinding = "chrome://browser/content/tabbrowser.xml#tab";
			dlTabsTab.tab.style.removeProperty("background-image");
			dlTabsTab.tab.style.removeProperty("background-position");
			dlTabsTab.tab.style.removeProperty("background-repeat");
			dlTabsTab.tab.style.removeProperty("min-height");
			
			// Hide the VBox
			var vbox = dlTabsTab.tabContent.getTabVBox();
			vbox.style.setProperty("display", "none", "important");
		},
		false);
	
	this.refresh = function()
	{
		//consoleLog("tabContent: refresh labels");
		this.refreshLabels();
		//consoleLog("tabContent: refresh progress");
		this.refreshProgress();
	};
	
	// Get the tab labels again in case the tab moved
	this.refreshLabels = function()
	{
		consoleLog("refreshLabels: " + this.labels);
	
		// Display the icon of the file
		this.tab.setAttribute("image", "moz-icon://" + dlTabsTab.localpath + "?size=16");
		
		// Refresh the size of the tab in case it was changed in prefs
		var tabHeight = dlTabsPrefs.getDisplayPref("tabHeight");
		this.tab.style.setProperty("min-height", tabHeight + "px", "important");
		
		// Only if the label box is found
		if(dlTabsTab.tabLabelBox.length > 0)
		{
			var vbox = dlTabsTab.tabLabelBox[0];
			vbox.style.setProperty("display", "", "important");
			
			this.labels = vbox.getElementsByClassName("dlTabs_tabLabel");
			consoleLog("refreshLabels: " + this.labels);
		
			var ETAIndex = dlTabsPrefs.getETAField();
			if(typeof(ETAIndex) != "undefined")
				this.labels[ETAIndex].setAttribute("value", dlTabsTab.ETA);
				
			var speedIndex = dlTabsPrefs.getSpeedField();
			if(typeof(speedIndex) != "undefined")
				this.labels[speedIndex].setAttribute("value", dlTabsTab.speed);
				
			var sizeIndex = dlTabsPrefs.getSizeField();
			if(typeof(sizeIndex) != "undefined")
				this.labels[sizeIndex].setAttribute("value", dlTabsTab.size);
				
			this.labels[2].style.setProperty("display", tabHeight >= 45 ? "" : "none", "important");
			this.labels[1].style.setProperty("display", tabHeight >= 30 ? "" : "none", "important");
		}
	};
	
	this.refreshProgress = function()
	{
		// 2) Progress bar in the tab
		
		var width = dlTabsTab.mainWindow.gBrowser.mStrip.getAttribute("width");
		/* Because Firefox doesn't support CSS3 background-size yet
		 * The progress bar is actually 4000px large, so it can "stretch"
		 * to fit screens up to 4000px width.
		 * It's shift right to match the progress
		 *
		 * Update (v1.0a2): FF has a CSS extension: -moz-background-size,
							but as a CSS exension I can't set it from JS (-_-), at least in FF3.5
		 */
		var x;
		if(dlTabsTab.download)
			x = width * dlTabsTab.download.amountTransferred / dlTabsTab.download.size - 4000;
		else
			x = -4000;
		this.tab.style.setProperty("background-position", x + "px 0px", "important");
	};
}